package com.welsy.authoring.vo.course
{
	import com.welsy.authoring.vo.course.pattern.*;
	import com.welsy.authoring.view.testcomponents.TestMapView;
	import com.welsy.authoring.view.testcomponents.QuestionMapView;
	import com.welsy.authoring.view.testcomponents.QuestionView;
	import com.welsy.authoring.view.testcomponents.AnswerView;
	import com.welsy.authoring.view.testcomponents.TestView;
	
	[Bindable]	
	public class TestComponents extends CourseItem 
	{
	  public var test:TestVO = new TestVO;
      
      private var _items:Array;

      public function TestComponents() {
         _items = new Array();
      }

      override public function addItem(item:ICourseItem):void {
         _items.push(item);
      }

      override public function removeItem(item:ICourseItem):void {
         var i:uint;
         // Loop through all the child elements.
         for(i = 0; i < _items.length; i++) {
            // If one of the elements matches the 
            // parameter remove it from the array.
            if(_items[i] == item) {
               _items.splice(i, 1);
               break;
            }
         }
      }
      override public function iterator():ICourseIterator {    
      	     
         return new ArrayCourseIterator(_items);
      }
	  
	  public function getCollection():Array {         
         return _items;
      }
	}
}